<h1>All organizations</h1>

<table>
  <tr>
    <th>Name</th>
  </tr>

<% for organization in @organizations %>
  <tr>
    <td><%= link_to organization.name, organization %></td>

	<% if organization.owner == current_user -%>
      <td><%= link_to 'Edit', edit_organization_path(organization) %></td>
      <td><%= link_to 'Destroy', organization, :confirm => 'Are you sure?', :method => :delete %></td>
	<% end -%>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New organization', new_organization_path %>
